var arr=[1,2,3,4,{a:1}];
console.log(arr,'原数组');
// 数组序列化 将数组转化为字符串并且以‘,’形式隔开每一项
var result=arr.toString();//1,2,3,4,[object Object]
console.log(result,typeof result);
// join 将数组转化为字符串
// var result1=arr.join('');//1234[object Object] 
var result1=arr.join(',');//1,2,3,4,[object Object]
var result1=arr.join('-');//
console.log(result1,typeof result1);
var obj={
    name:"zhangsan"
}
console.log(obj.toString(),typeof (obj.toString()),'对象调用tostring');